﻿using DevExpress.Web.ASPxCallback;
using DevExpress.Web.ASPxEditors;
using DevExpress.Web.ASPxFormLayout;
using Kaysite.Controller;
using Kaysite.Manager;
using Kaysite.Model;

public partial class Controls_AdminControls_ServiceGroupEdit : BaseEditControl<ServiceGroupManager, ServiceGroupController, ServiceGroup>
{
    protected override ASPxCallback GetCallbackControl()
    {
        return clbkSave;
    }

    protected override ASPxButton GetCancelButton()
    {
        return btnCancel;
    }

    protected override ASPxButton GetOkButton()
    {
        return btnOk;
    }

    protected override ASPxFormLayout Layout
    {
        get { return frmEditLayout; }
    }

    protected override void DoInitialize_2_LoadDataInitControls()
    {
        base.DoInitialize_2_LoadDataInitControls();
        InitComboEnum<eDisplayOption>(ddlDisplayOption, e0Type.DontNeed);
    }

    protected override void LoadModelDataFromControls(ServiceGroup model)
    {
        model.GroupName = GetValue<string>(txtName);
        model.DisplayInMain = GetValue<eDisplayOption>(ddlDisplayOption);
    }
}